Filter empty database parameters to prevent MySQL command failures#308
Draft
Filter empty database parameters to prevent MySQL command failures#308
Conversation
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix mysqlcheck character set error in wp-cli
Filter empty database parameters to prevent MySQL command failures
Feb 1, 2026
Member
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request aims to prevent MySQL command failures by filtering out empty database parameters. The approach is sound, but the current implementation has a flaw: it filters parameters from wp-config.php before merging them with command-line arguments. This means the fix can be bypassed if an empty value is provided as a command-line argument. I've suggested applying the filter after all arguments are merged to create a more robust solution.
Additionally, the new test case for an empty DB_CHARSET doesn't actually exercise the new filtering logic due to a pre-existing condition. I've recommended an alternative test scenario that would better validate the changes.
This comment was marked as resolved.
This comment was marked as resolved.
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
This comment was marked as resolved.
This comment was marked as resolved.
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix Plan: mysqlcheck empty character set error
run()function to identify where empty values are addedrun()function to skip empty string and null values$final_argsafter merge to catch empty CLI argsDB_HOSTinstead ofDB_CHARSETSummary
Successfully fixed the issue where database commands fail when DB constants are empty strings. The fix:
$final_argsafter merging to catch empty values from both wp-config and CLI argsDB_HOSThandling and verifies successful executionOriginal prompt
This section details on the original issue you should resolve
<issue_title>mysqlcheck: Character set '' is not a compiled character set</issue_title>
<issue_description>## Bug Report
When running commands related to
dbat hostinger, I get the following error.Hostinger support said it's a bug with the wp-cli, and my debug shows the same..
Describe the current, buggy behavior
When running
wp db checkin any of my wp installs at hostinger, I get the following:With debug...
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.